package com.frontier.consumer8003.feign.factory;

import com.frontier.consumer8003.feign.ProviderFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * feign降级处理
 *
 * @author YLS-XuXu
 * @time 2022/2/24
 */
@Slf4j
@Component
public class ProviderFeignClientFallbackFactory implements FallbackFactory<ProviderFeignClient> {

    @Override
    public ProviderFeignClient create(Throwable throwable) {
        return new ProviderFeignClient() {
            @Override
            public String testGateWay() {
                return "openFeign调用生产者失败";
            }
        };
    }
}
